import {ROLE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

export async function listRoleByPage(currentPage, size) {
    return request(ROLE, METHOD.GET, {
        currentPage: currentPage,
        size: size
    })
}

export async function totalRole() {
    return request(ROLE+"/total", METHOD.GET)
}

export async function deleteRole(id) {
    return request(ROLE, METHOD.DELETE, {
        id: id
    })
}

export async function editRole(role) {
    return request(ROLE, METHOD.POST, {
        id: role.id,
        name: role.name,
        alias: role.alias,
        weight: role.weight
    })
}
